<?php
include "../../fun.php";
isLogin();
$db=conndb();
$aboutusSortId=$_POST["aboutusSortId"];
$sql_name="select * from sortclass where id='{$aboutusSortId}'";
$re=query1($db,$sql_name,false);
$aboutus_name=$re["sortname"];
$content=isset($_POST["content"])?$_POST["content"]:'';
$id=isset($_POST["id"])?$_POST["id"]:'';
if ($id) {
    $sql="update aboutus set aboutus_name='{$aboutus_name}',content='{$content}' where id='{$id}'";
}else {
    $sql="insert into aboutus (aboutus_name,content) values ('{$aboutus_name}','{$content}')";
}
$db->exec($sql);
$data=["code"=>0,"msg"=>"操作成功"];
echo json_encode($data,JSON_UNESCAPED_UNICODE);
?>